package com.hengxinguotong.hxgtwygsp.ui.main;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 *
 * desc:应用自启动
 */
public class AutoStartReceiver extends BroadcastReceiver {

    final String ACTION = "android.intent.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent.getAction().equals(ACTION)){
            Intent mainActIntent = new Intent(context,MainActivity.class);
            mainActIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(mainActIntent);
        }
    }
}
